package com.myebills.ebpsfrontend.cust.maxis;

import com.myebills.ebpsfrontend.cust.controller.*;
import com.checkfree.isolutions.customer.persist.Account;
import com.checkfree.isolutions.customer.persist.User;
import com.checkfree.isolutions.admin.ObjectId;
import com.checkfree.isolutions.statement.persist.Statement;
import com.checkfree.isolutions.statement.StatementSection;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.xml.sax.InputSource;
import org.w3c.dom.*;
import java.io.*;
import java.lang.Exception;
import javax.xml.parsers.*;
/*import my.com.maxis.*;
import my.com.maxis.dao.AccountInfoDao;
import my.com.maxis.dao.LobOutputDao;
import my.com.wsClient.*;
*/
public class SsoServlet extends EbppxTransactionServlet {

    /**
     *
     *
     */
    public void doTransaction(HttpServletRequest req, HttpServletResponse res)
    throws ServletException {
        try {
            final HttpSession session = req.getSession(false);
            if (null == session) {
                throw new ServletException("Session must be already established");
            }


            final String cpId = req.getParameter("cpId");
            final String userId = req.getParameter("userId");
            final String sid = req.getParameter("sid");
            final String fid = req.getParameter("fid");
            final String hs = req.getParameter("hs");

            req.setAttribute("cpId", cpId);
            req.setAttribute("userId", userId);
            req.setAttribute("sid", sid);
            req.setAttribute("fid", fid);
            req.setAttribute("hs", hs);

			/*if(sid!=null && !sid.equals("0") && !sid.equals("")){
				if(fid!=null && !fid.equals("0") && !fid.equals("")){
					maxisSSOClient ssoClient = new maxisSSOClient();
					ssoClient.service(sid,fid,userId,cpId,"");
				}
			}*/


            forwardToMappedUrl(req, res, EbppxConstants.URL_JSP_PARAM);
        } catch (ServletException e) {
            // Just re-throw these
            throw e;
        } catch (Throwable t) {
            throw new ServletException(t.toString(), t);
        }
    }
}